clear all
set more off
cd ""

use "sample.dta", clear

bysort city_ch: keep if _n == 1
gen csm_time = 1 + mdy(csm_month,csm_day,2020) - mdy(1,1,2020)

* T-test by patronage connection

ttest age, by(faction)
prtest male, by(faction)
prtest minor, by(faction)
prtest college, by(faction)
ttest wkexp, by(faction)
prtest dispatch, by(faction)
prtest lateral, by(faction)
ttest tenure, by(faction)
prtest shareht, by(faction)
prtest sharesch, by(faction)
prtest sharewp, by(faction)

prtest citysort1, by(faction)
prtest citysort2, by(faction)
ttest gdppc, by(faction)
ttest gdpg, by(faction)
ttest pdensity, by(faction)
ttest fiscal, by(faction) 
ttest hlthworker, by(faction) 
ttest rct_bdindex, by(faction)
ttest wkaction, by(faction)
ttest distance_toWuhan, by(faction)

ttest csm_time, by(faction)
ttest betdays, by(faction)

* Correlation with CSM timing

pwcorr faction csm_time, sig
pwcorr age csm_time, sig
pwcorr male csm_time, sig
pwcorr minor csm_time, sig
pwcorr college csm_time, sig
pwcorr wkexp csm_time, sig
pwcorr dispatch csm_time, sig
pwcorr lateral csm_time, sig
pwcorr tenure csm_time, sig
pwcorr shareht csm_time, sig
pwcorr sharesch csm_time, sig
pwcorr sharewp csm_time, sig

pwcorr citysort1 csm_time, sig
pwcorr citysort2 csm_time, sig
pwcorr gdppc csm_time, sig
pwcorr gdpg csm_time, sig
pwcorr pdensity csm_time, sig
pwcorr fiscal csm_time, sig
pwcorr hlthworker csm_time, sig
pwcorr rct_bdindex csm_time, sig
pwcorr wkaction csm_time, sig
pwcorr distance_toWuhan csm_time, sig

pwcorr betdays csm_time, sig
